package io.lkt.modules.sys.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import io.lkt.common.utils.PageUtils;
import io.lkt.common.utils.Query;
import io.lkt.commons.dynamic.datasource.annotation.DataSource;
import io.lkt.modules.sys.dao.ArticleLookDetailLogDao;
import io.lkt.modules.sys.dao.KeywordDetailLogDao;
import io.lkt.modules.sys.entity.ArticleLookCensusEntity;
import io.lkt.modules.sys.entity.KeywordDetailLogEntity;
import io.lkt.modules.sys.entity.KeywordSumLogEntity;
import io.lkt.modules.sys.service.ArticleLookCensusService;
import io.lkt.modules.sys.service.KeywordDetailLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;


@Service("ArticleLookCensusService")
public class ArticleLookCensusServiceImpl extends ServiceImpl<ArticleLookDetailLogDao, ArticleLookCensusEntity> implements ArticleLookCensusService {
    @Autowired
    private ArticleLookDetailLogDao articleLookDetailLogDao;

    @Override
    @DataSource("logdb")
    public PageUtils queryPage(Map<String, Object> params) {
        IPage<ArticleLookCensusEntity> page = this.page(
                new Query<ArticleLookCensusEntity>().getPage(params),
                new QueryWrapper<ArticleLookCensusEntity>()
        );

        return new PageUtils(page);
    }

    @Override
    @DataSource("logdb")
    public List<ArticleLookCensusEntity> queryList(Map<String, Object> map) {
        return articleLookDetailLogDao.queryList(map);
    }

    @Override
    @DataSource("logdb")
    public List<ArticleLookCensusEntity> queryVitalLook(Map<String, Object> map) {
        return articleLookDetailLogDao.queryVitalLook(map);
    }

    @Override
    public List<ArticleLookCensusEntity> queryVitalShare(Map<String, Object> map) {
        return articleLookDetailLogDao.queryVitalShare(map);
    }

    @Override
    public List<ArticleLookCensusEntity> queryVitalClock(Map<String, Object> map) {
        return articleLookDetailLogDao.queryVitalClock(map);
    }

}
